import {post} from '@/service/Request' 
import { get } from './Request';
import { getComments } from './Request';

//登录接口
export const Login = (loginprs)=>post('/api/auth/login',loginprs);
//注册接口
export const Register = (registerprs)=>post('/api/auth/register',registerprs);
//获取文章列表
export const GetArticle = () => get('/api/article/writes/?include=user');
//发布文章接口
export const PublishArticle  =(ArticleContent) => post('/api/article/writes',ArticleContent)
//获取文章详情
export const ArticleDetails = (ArticleId) => get(`api/article/writes/${ArticleId}`)
//获取个人信息
export const Beedback = (content) => post('api/article/feedback',content)
//获取评论
export const GetComments = (write_id) => getComments('/api/article/comments/',write_id)
//发布评论
export const PostComments = (CommentInformation) =>post('/api/article/comments',CommentInformation)
//修改个人信息
export const ChangeInformation = (Information)=>post('/api/article/infochange',Information)
//获取个人信息
export const GainInformation = ()=>get('/api/article/userinfo')
//上传头像
export const UploadAvatar = (AvatarUrl) => post('/api/article/avatarchange',AvatarUrl)
//专栏
export const GainCategories = () =>get('/api/article/categories/')
//收藏文章
export const CollectArticle = (Writeid) =>post('/api/article/col',Writeid)
//查看收藏文章
export const ViewCollect =() =>get('/api/article/collect_show')